#ifndef MLOADER_MATERIAL
#define MLOADER_MATERIAL

#include "Common.h"
#include "Texture.hpp"
#include "Variable.hpp"

namespace MLoader
{
    class Material
    {
    public:
        typedef enum TextureType
        {
            Diffuse     = 0x0,
            Normal      = 0x1,
            Specular    = 0x2,
            Ambient     = 0x3,
            Emissive    = 0x4,
            LightMap    = 0x5,
            Shininess   = 0x6,
            Opacity     = 0x7,
            Height      = 0x8,
            Reflection  = 0x9,
            Count       = 0x10
        } TextureType;
        
        inline void SetProperty(const TextureType& type, Variable& val) {
            Property[TextureTypeStr(type)] = val;
        }
        inline Variable& GetProperty(const TextureType& type) {
            return Property[TextureTypeStr(type)];
        }
        inline void SetProperty(const std::string& key, Variable& val) {
            Property[key] = val;
        }
        inline Variable& GetProperty(const std::string& key) {
            return Property[key];
        }
                
    private:
        inline static std::string& TextureTypeStr(const TextureType& type) {
            static std::string EnumStrings[] = {
                "TexDiffuse",
                "TexNormal",
                "TexSpecular",
                "TexAmbient",
                "TexEmissive",
                "TexLightMap",
                "TexShininess",
                "TexOpacity",
                "TexHeight",
                "TexReflection",
            };
            
            return EnumStrings[static_cast<int>(type)];
        }
        
        std::unordered_map<std::string, Variable> Property;
    };
}


#endif // MLOADER_MATERIAL
